export default (listeners = {}) => {
    return {
        itemStyle: {padding: '0px 8px 0px 8px'},
        formItems: [

            {
                field: 'email',
                type: 'input',
                label: '邮箱',
            },
            {
                field: 'authorizationCode',
                type: 'input',
                label: '授权码',
            },
            {
                field: 'host',
                type: 'input',
                label: '服务器域名',
            },
            {
                field: 'port',
                type: 'input',
                label: '端口',
            },
            {
                field: 'protocol',
                type: 'input',
                label: '协议',
            },
            {
                field: 'username',
                type: 'input',
                label: '用户名',
            },
            {
                field: 'enable',
                type: 'radio',
                label: '状态',
                isGroup: true,
                options: [],
                config: {
                    clearable: false,
                },
                optionConfig: {
                    border: true,
                },
            },
            {
                field: 'remark',
                type: 'textarea',
                label: '备注',
                config: {
                    autosize: {minRows: 4, maxRows: 6},
                    maxlength: 500,
                    showWordLimit: true,
                },
                layout: {
                    xl: {span: 24},
                    lg: {span: 24},
                    md: {span: 24},
                    sm: {span: 24},
                    xs: {span: 24},
                }
            },

        ],
        colLayout: {
            xl: 12,
            lg: 12,
            md: 12,
            sm: 12,
            xs: 24,
        },
        elFormConfig: {
            labelWidth: '140px',
            rules: {
                email: [
                    {required: true, message: '邮箱不能为空', trigger: 'blur'},
                    {
                        type: 'email',
                        message: '请输入正确的邮箱地址',
                        trigger: ['blur', 'change'],
                    },
                ],
                authorizationCode: [
                    {required: true, message: '授权码不能为空', trigger: 'blur'},],
                enable: [
                    {required: true, message: '状态不能为空', trigger: 'blur'},
                ],
            },
        },
    }
}
